﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleClient.CityService;   //this namespace.service reference
using ConsoleClient.ShowService;

namespace ConsoleClient
{
    class Program
    {
        //Client app. 
        static void Main(string[] args)
        {
            showTest();
           //cityTest();
            Console.ReadKey();
        }


        public static void showTest()
        {
            using (ShowService.ShowClient showService = new ShowClient())
            {
                
                Show show = showService.GetShow(1);
                Console.WriteLine(show.Type.ToString());

            }
        }

        public static void cityTest()
        {
            using (CityService.CitiesClient city = new CitiesClient())
            {
                city.AddCityToDB(9610, "nørager");
                city.AddCityToDB(9620, "aalestrup");
                city.AddCityToDB(9000, "aalborg");
                Console.WriteLine("Data inserted");

                City c = city.RetrieveCity(9610);
                Console.WriteLine("Name: " + c.CityName + " Postal Code: " + c.PostalCode);

                IList<City> cities = city.RetrieveAllTheCities();


                Console.WriteLine("--------------------");
                foreach (City ci in cities)
                {
                    Console.WriteLine(ci.CityName + " - " + ci.PostalCode);
                    Console.WriteLine("--------------------");
                }

                Console.ReadKey();
                city.DeleteCities();
            }
        }
    }
}
